﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArithmeticLibrary.Tree
{
    /// <summary>
    /// Trida reprezentujici uzel s operatorem minus.
    /// </summary>
    public class MinusNode : BinaryOperatorNode
    {
        public MinusNode()
        {
            this.Left = null;
            this.Right = null;
        }

        public MinusNode(Node left, Node right)
        {
            this.Left = left;
            this.Right = right;
        }

        public override double Evaluate(double x)
        {
            return Left.Evaluate(x) - Right.Evaluate(x);
        }

        public override R Accept<R, C>(IExpressionVisitor<R, C> visitor, C context)
        {
            return visitor.Visit(this, context);
        }
    }
}
